#include "../JuceLibraryCode/JuceHeader.h"
#include "MainWindow.h"
BaiNa8* baina8;

//==============================================================================
class WorldApplication  : public JUCEApplication
{
public:
    //==============================================================================
    WorldApplication()
    {
    }

    ~WorldApplication()
    {
    }

    //==============================================================================
    void initialise (const String& commandLine)
    {
        // Do your application's initialisation code here..
		baina8 = new BaiNa8(600, 800, "127.0.0.1", 8088);
        mainWindow = new MainAppWindow();
    }

    void shutdown()
    {
        // Do your application's shutdown code here..
        mainWindow = 0;
		delete baina8;
    }

    //==============================================================================
    void systemRequestedQuit()
    {
		baina8->stop();
        quit();
    }

    //==============================================================================
    const String getApplicationName()
    {
        return "World";
    }

    const String getApplicationVersion()
    {
        return ProjectInfo::versionString;
    }

    bool moreThanOneInstanceAllowed()
    {
        return true;
    }

    void anotherInstanceStarted (const String& commandLine)
    {
        
    }

private:
    ScopedPointer <MainAppWindow> mainWindow;
};

//==============================================================================
// This macro generates the main() routine that starts the app.
START_JUCE_APPLICATION(WorldApplication)
